<?php
    class BackupAction extends CommonAction {
        Public function index(){
            $this->display();
        }
        public function handle(){
            $filename='../Uploads/Backup/'.date('Y-m-d-H-i-s',time());
            mkdir($filename);
            
           mysql_query('SET NAMES UTF8');
           $dbname=C('DB_NAME');
           $result = mysql_query("show table status from $dbname");
           while($data=mysql_fetch_array($result)) {
                dump_table($data[Name],$filename);
           }
           $this->success('备份完成！',U('index'));
        }
}